package com.security.door.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.security.door.core.base.BaseService;
import com.security.door.dao.mapper.devFuncpointMapper;
import com.security.door.model.domain.devFuncpoint;
import com.security.door.model.dto.devFuncpointDto;
import com.security.door.service.IdevFuncPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class devFuncPointServiceImpl extends BaseService<devFuncpoint> implements IdevFuncPointService {

    @Autowired
    devFuncpointMapper idevFuncpointMapper;

    public PageInfo<devFuncpoint> queryListWithPage(devFuncpointDto entity) {
        PageHelper.startPage(entity.getPageIndex(), entity.getPageSize());
        var actionList = idevFuncpointMapper.queryListWithPage(entity);
        return new PageInfo<>(actionList);
    }

    public boolean hasActiveNo(devFuncpoint entity) {
        return idevFuncpointMapper.hasActiveNo(entity) > 0 ? true : false;
    }

    public void deleteByGuids(String guids) {
        idevFuncpointMapper.deleteByGuids(guids);
    }

}
